import {request} from "../request";

//1、新建一个出差申请
export function createEvectionProcess({startUserId, num, description, manager, gm, finance, beginDate, endDate,}) {
	return request({
		url: '/process/evection/create',
		method: 'post',
		data: {
			startUserId,
			num,
			description,
			manager,
			gm,
			finance,
			beginDate,
			endDate,
		}
	})
}

//2、查询我创建的出差申请
export function queryMyStartEvection(userId){
	return request({
		url: '/process/evection/personal-evection-apply',
		method: 'get',
		params: {
			userId
		}
	})
}

//3、查看我要处理的出差任务
export function queryMyEvectionTask(userId){
	return request({
		url: '/process/evection/audit-task',
		method: 'get',
		params: {
			userId
		}
	})
}

//4、审批处理
export function auditEvection({taskId,approved,reply}){
	return request({
		url: '/process/evection/complete-task',
		method: 'put',
		params: {
			taskId,
			approved,
			reply
		}
	})
}

//5、查看我的出差申请详情
export function lookEvectionDetail(processInstanceId){
	return request({
		url: '/process/evection/evection-apply-detail',
		method: 'get',
		params: {
			processInstanceId
		}
	})
}

//6、查看出差任务详情
export function queryEvectionAccreditationDetail(taskId){
	return request({
		url: '/process/evection/accreditation-detail',
		method: 'get',
		params:{
			taskId
		}
	})
}